{include file="merchant/integral/owner_search.tpl"}
<div class="div_line"></div>

{if $ownerExist eq 1}
<div class="integral_owner">
{include file="merchant/integral/owner_info.tpl"}
<div class="div_line"></div>
{if $ownerInfo.card_status eq 1 and $ownerInfo.pay_status eq 1 and ($hasRef eq 0 or ($hasRef eq 1 and $ownerShopRe.owner_card_status eq 1))}
{assign var=use_jifen value=0}
{assign var=use_zhekou value=0}
<form action="/merchant/integral/addConfirm" id="formUpdate" method="post">
<table>
	<tr>
		<th></th>
		<td>
			<input type="hidden" name="txt_owner_id" id="txt_owner_id" value="{$ownerInfo.owner_id}" />
			{if $hasRef eq 0}
			{assign var=use_jifen value=1}
			<input type="radio" name="r_discount" value="1" id="r_discount_jifen" onclick="chengeDiscountType()" checked="checked" /><label for="r_discount_jifen">送积分</label>
			<input type="radio" name="r_discount" value="2" id="r_discount_zhekou" onclick="chengeDiscountType()" /><label for="r_discount_zhekou">折扣</label>
			{else}
				{if $ownerShopRe.balance > 0}
					{if $ownerShopRe.c_discount_type eq 1}
						{assign var=use_jifen value=1}
						<input type="radio" name="r_discount" value="1" id="r_discount_jifen" onclick="chengeDiscountType()" checked="checked" /><label for="r_discount_jifen">送积分</label>
					{else}
						{assign var=use_zhekou value=1}
						<input type="radio" name="r_discount" value="2" id="r_discount_zhekou" onclick="chengeDiscountType()" checked="checked" /><label for="r_discount_zhekou">折扣</label>
					{/if}
				{else}
					{assign var=use_jifen value=1}
					<input type="radio" name="r_discount" value="1" id="r_discount_jifen" onclick="chengeDiscountType()" checked="checked" /><label for="r_discount_jifen">送积分</label>
					<input type="radio" name="r_discount" value="2" id="r_discount_zhekou" onclick="chengeDiscountType()" /><label for="r_discount_zhekou">折扣</label>
				{/if}
			{/if}
		</td>
	</tr>
	<tr>
		<th width="120px" align="right">请输入增加积分：</th>
		<td>
			<input type="text" class="input_c" style="width:200px;" name="txt_jifen" id="txt_jifen" />
			<span id="jifenError" class="color_red"></span>
		</td>
	</tr>
	<tr class="discount_1" {if $use_jifen eq 0}style="display:none;"{/if}>
		<th align="right">请输入赠送积分：</th>
		<td>
			<input type="text" class="input_c" style="width:200px;" name="txt_jifen_add" id="txt_jifen_add" />
			<span id="jifenAddError" class="color_red"></span>
		</td>
	</tr>
	<tr class="discount_2" {if $use_zhekou eq 0}style="display:none;"{/if}>
		<th align="right">请输入折扣率：</th>
		<td>
			<input type="text" class="input_c" style="width:200px;" name="txt_discount" id="txt_discount" />
			<span class="color_d" style="font-weight:normal;">例:0.85代表85折</span><span id="discountError" class="color_red"></span>
		</td>
	</tr>
	<tr>
		<th>
		</th>
		<td>
			<div class="btn_green"><input type="button" onclick="addIntegral()" value="确  定" /></div>
		</td>
	</tr>
</table>
</form>
{/if}
</div>
{/if}